<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Users.aspx.cs" Inherits="Users" Title="ABC SuperSign - Users" %>
<%@ Register Src="UserAccess.ascx" TagName="UserAccess" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="GlobalAjax.ascx" TagName="GlobalAjax" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder_Main" Runat="Server">
<form action="#" runat="server">
<asp:ScriptManager ID="ScriptManager_Users" runat="server">
</asp:ScriptManager>
<uc1:UserAccess ID="UserAccess1" runat="server" />
<uc2:GlobalAjax ID="ctl_GlobalAjax" runat="server" />

<!-- page title start winston -->
<asp:UpdatePanel ID="UPanel_Header" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ListBox_Users" EventName="SelectedIndexChanged" />
        <asp:AsyncPostBackTrigger ControlID="Btn_NewUser" EventName="Click" />
    </Triggers>
    <ContentTemplate>
        <h1>
            <span><asp:Label ID="Lbl_PageHeader" runat="server">Users</asp:Label></span>
            <asp:Button ID="Btn_NewUser" runat="server" Text="Create New User" OnClick="Btn_NewUser_Click" CssClass="aspButton" />
            <asp:Button ID="Btn_EditUser" runat="server" Text="Edit User" OnClick="Btn_EditUser_Click" CssClass="aspButton" />
        </h1>
    </ContentTemplate>
</asp:UpdatePanel>
<!-- page title end -->
<!-- Main Content start -->
<div class="mainHolder"> 
<!-- left block start -->
<div class="leftBlock">
	<h2>
		<span>Select User to Edit</span>&nbsp;
	</h2>
	<div class="innerContent" >
		<asp:UpdatePanel ID="UPanel_UserList" runat="server">
		    <Triggers>
		        <asp:AsyncPostBackTrigger ControlID="Check_Disabled" EventName="CheckedChanged" />
		        <asp:AsyncPostBackTrigger ControlID="Btn_Disable" EventName="Click" />
		        <asp:AsyncPostBackTrigger ControlID="Btn_Enable" EventName="Click" />
		        <asp:AsyncPostBackTrigger ControlID="Btn_NewUser" EventName="Click" />
		    </Triggers>
            <ContentTemplate>
                <div class="row widthM centerH">
                    <asp:Button ID="Btn_Refresh" runat="server" Text="Refresh Users List" OnClick="Btn_Refresh_Click" CssClass="widthM" /><br />
                </div>
                <div class="row widthM centerH">
                    <asp:ListBox ID="ListBox_Users" runat="server" AutoPostBack="True" CssClass="widthM heightM" OnSelectedIndexChanged="ListBox_Users_SelectedIndexChanged"></asp:ListBox>
                </div>
                <div class="row widthM centerH">
                    <asp:CheckBox ID="Check_Disabled" runat="server" AutoPostBack="True" CssClass="aspCheckBox" OnCheckedChanged="Check_Disabled_CheckedChanged" />
                    Show Disabled Users
                </div>
                <div class="row widthM centerH">
                    <asp:Button ID="Btn_Disable" runat="server" Text="Disable User" CssClass="widthM" OnClick="Btn_Disable_Click" />
                </div>
                <div class="row widthM centerH">
                    <asp:Button ID="Btn_Enable" runat="server" Text="Enable User" CssClass="widthM" OnClick="Btn_Enable_Click" />
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
	</div>
</div>
<!-- left block end -->
<!-- right block start -->
<asp:UpdatePanel ID="UPanel_UserDetails" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ListBox_Users" EventName="SelectedIndexChanged" />
    </Triggers>
    <ContentTemplate>
        <div class="rightBlock">
            <h2>
                <span>User Editor&nbsp;</span>
                <asp:Button ID="Btn_CancelChanges" OnClick="Btn_CancelChanges_Click" runat="server"
                    CssClass="aspButton" Text="Cancel Changes" Enabled="False"></asp:Button>
                <asp:Button ID="Btn_Save" OnClick="Btn_Save_Click" runat="server" CssClass="aspButton"
                    Text="Save User" Enabled="True"></asp:Button>
            </h2>
            <div class="row">
                <asp:HiddenField ID="Hidden_UserID" runat="server"></asp:HiddenField>
                <asp:Label ID="Lbl_EditorAlerts" runat="server" CssClass="aspLabelAlertFail" Visible="False"></asp:Label>
            </div>
            <div class="innerBlock">
                <h3>
                    <span>User Details</span> <a class="switch" href="#">Open/Collapse</a>
                </h3>
                <div class="innerContent">
                    <div class="row">
                        <div class="col widthM">
                            <asp:HiddenField ID="Hidden_ID" runat="server"></asp:HiddenField>
                            <label>
                                Username</label>
                            <asp:TextBox ID="TBox_UserName" TabIndex="1" runat="server" CssClass="aspTextBox"
                                Enabled="False"></asp:TextBox>
                        </div>
                        <div class="spacerXL"></div>
                        <div class="col widthM">
                            <label>
                                Password</label>
                            <asp:TextBox ID="TBox_Password" TabIndex="2" runat="server" CssClass="aspTextBox"
                                TextMode="Password"></asp:TextBox>
                        </div>
                        <div class="spacerXL"></div>
                        <div class="col widthM">
                            <label>
                                    Confirm Password</label>
                            <asp:TextBox ID="TBox_ConfirmPassword" TabIndex="3" runat="server" CssClass="aspTextBox"
                                TextMode="Password"></asp:TextBox> 
                        </div>
                        <div class="spacerXL"></div>
                        <div class="col">    
                            <label>
                                    User Type</label>
                            <asp:TextBox ID="TBox_UserTypeID" TabIndex="3" runat="server" CssClass="aspTextBox"
                                Visible="false"></asp:TextBox>
                            <asp:DropDownList ID="DDL_UserType" TabIndex="3" runat="server">
                            </asp:DropDownList>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col widthM">
                            <label>
                                First Name</label>
                            <asp:TextBox ID="TBox_FirstName" TabIndex="4" runat="server" CssClass="aspTextBox"></asp:TextBox>
                        </div>
                        <div class="spacerXL"></div>
                        <div class="col widthM">
                            <label>
                                Last Name</label>
                            <asp:TextBox ID="TBox_LastName" TabIndex="5" runat="server" CssClass="aspTextBox"></asp:TextBox>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col widthM">                
                            <label>
                                Email</label>
                            <asp:TextBox ID="TBox_Email" TabIndex="6" runat="server" CssClass="aspTextBox"></asp:TextBox>
                        </div>
                        <div class="spacerXL"></div>
                        <div class="col widthM">
                            <label>
                                Phone</label>
                            <asp:TextBox ID="TBox_Phone" TabIndex="7" runat="server" CssClass="aspTextBox"></asp:TextBox>
                        </div>
                    </div>
                </div>
            </div>
            <div class="innerBlock">
                <h3>
                    <span>User Alerts</span> <a class="switch" href="#">Open/Collapse</a>
                </h3>
                <div class="innerContent">
                    <div class="row">
                        <asp:Panel ID="UserAlerts" runat="server">
                        </asp:Panel>
                    </div>
                </div>
            </div>
            <div class="innerBlock collapsed">
                <h3>
                    <span>Log</span> <a class="switch" href="#">Open/Collapse</a>
                </h3>
                <div class="innerContent">
                    <asp:TextBox ID="TextBox1" runat="server" class="TextArea_Log" Rows="2" cols="20"
                        TextMode="MultiLine"></asp:TextBox></div>
            </div>
        </div>
</ContentTemplate>
</asp:UpdatePanel>
<!-- right block end -->
</div>
<!-- main content end -->
</form>
<%--<form action="handler"
onsubmit="return validateNumber(this.TBox_Phone, 'Please enter a phone number', 5,10);">
</form>--%>
</asp:Content>

